package com.community.process._1010.domains;

import com.community.process._1010.common.api.InPage;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Description: 成品菜
 * @Author: Administrator to Zbs
 * @Date: 2024/9/6 星期五 14:52
 */
public class ProcessFoodItemDTO {

    @Getter
    @Setter
    public static class FoodItemPageSearch extends InPage {

        @Schema(description = "食材名称")
        private String name;

        @Schema(description = "分类ID")
        private Long categoryId;

        @Schema(description = "分类树的tree code")
        private String categoryTreeCode;

        @Schema(description = "上下架 1 上架 0 下架")
        private Integer up;

        @Schema(description = "食材ID列表，推荐菜查询填这个")
        private List<Long> ingredientsIdList;
    }

    @Getter
    @Setter
    public static class FoodItemBase {

        @Schema(description = "菜品名称")
        @NotBlank(message = "菜品名称不能为空")
        private String name;

        @Schema(description = "描述")
        private String description;

        @Schema(description = "菜品图片")
        @NotBlank(message = "菜品图片不能为空")
        private String image;

        @Schema(description = "重量单位")
        @NotBlank(message = "重量单位不能为空")
        private String units;

        @Schema(description = "重量")
        @NotNull(message = "重量不能为空")
        private Integer weight;

        @Schema(description = "分类ID")
        @NotNull(message = "分类ID不能为空")
        private Long categoryId;

        @Schema(description = "成品菜价格 单位：元")
        @NotNull(message = "价格不能为空")
        private BigDecimal price;

        @Schema(description = "菜品食材")
        private List<ProcessFoodItemIngredientsDTO.IngredientsFoodItemAdd> ingredients;
    }

    @Getter
    @Setter
    public static class FoodItemAdd extends FoodItemBase {
    }

    @Getter
    @Setter
    public static class FoodItemUpdate extends FoodItemBase {
        /**
         * ID
         */
        @Schema(description = "ID",requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull(message = "ID不能为空")
        private Long id;

        @Schema(description = "上下架 1 上架 0 下架")
        @NotNull(message = "上下架状态不能为空")
        private Integer up;
    }

    @Getter
    @Setter
    public static class FoodItemDelete {
        /**
         * ID
         */
        @Schema(description = "ID",requiredMode = Schema.RequiredMode.REQUIRED)
        @NotEmpty(message = "ID不能为空")
        private List<Long> ids;
    }

    /**
     * 批量上下架
     */
    @Getter
    @Setter
    public static class FoodItemSetUp {
        /**
         * ID
         */
        @Schema(description = "ID",requiredMode = Schema.RequiredMode.REQUIRED)
        @NotEmpty(message = "ID不能为空")
        private List<Long> ids;

        @Schema(description = "上下架 1 上架 0 下架")
        @NotNull(message = "上下架状态不能为空")
        private Integer up;
    }
}
